import request from '@/http/request'
// 头像
/** 上传图片/文件地址 **/
export const upload = {
    avatar: request.baseUrl + '/api/ossFiles/avatar',
    ifBG: request.baseUrl + '/api/ossFiles/ifBG',
    wxFile: request.baseUrl + '/api/ossFiles/wxFile',
  }


// 用户信息
export const $getUserInfo = () => {
    return request.request({
      url: '/api/current/user',
      method: 'get'
    })
  }

  export const $updateUserInfo = (parameter) => {
    return request.request({
      url: '/api/current/user',
      method: 'put',
      data: parameter
    })
  }

  export const $updateUserPass = (parameter) => {
    return request.request({
      url: '/api/current/modifyPwd',
      method: 'put',
      data: parameter
    })
  }

  /** MFA认证信息 **/
export const $getMFAInfo = ()  =>{
    return request.request({
      url: '/api/current/mfaInfo',
      method: 'get'
    })
  }

  /** MFA认证绑定 **/
export const $mfaBind = (parameter) => {
    return request.request({
      url: '/api/current/mfaBind',
      method: 'put',
      data: parameter
    })
  }

  /** MFA认证解绑 **/
export const $mfaRelieve = (parameter) => {
    return request.request({
      url: '/api/current/mfaRelieve',
      method: 'put',
      data: parameter
    })
  }

  export const $getPasswordRules = () =>{
    return request.request({
      url: '/api/anon/cipher/pwdRulesRegexp',
      method: 'get'
    })
  }